<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 400px;
            height: 400px;
            border: solid;
        }
    </style>
</head>

<body>

    <div id="box">
        hello box
    </div>
    <script>
        const box = document.getElementById('box');
        box.onmousedown = function () {
            console.log('鼠标按下', 'onmousedown');
        }
        box.onmouseup = function () {
            console.log('鼠标抬起', 'onmouseup');
        }

        box.onmouseover = function () {
            console.log('鼠标移入', 'onmouseover');
        }

        box.onmouseout = function () {
            console.log('鼠标移出', 'onmouseout');
        }

        box.onclick = function () {
            console.log('鼠标单击', 'onclick');
        }

        box.ondblclick = function () {
            console.log('鼠标双击', 'ondblclick');
        }

        box.oncontextmenu = function () {
            console.log('鼠标右击菜单', 'oncontextmenu');
        }

    </script>

</body>

</html>